package com.atguigu.study.controller;

import dev.langchain4j.model.chat.ChatModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Marco
 * @Description
 * @date 2025/8/18 20:10
 * @email 3293336923@qq.com
 */
@Slf4j
@RestController
public class ModelParameterController {

    @Autowired
    private ChatModel  chatModel;

    @GetMapping("marco/api01")
    public     String    prompt(@RequestParam(name = "question" , defaultValue = "你是谁？") String   question){

        String result = chatModel.chat(question);

        log.info("result:{}", result);

        return   result;

    }



}
